From: Colin Walters Date: Wed, 9 Sep 2009 19:49:31 +0000 (-0400) Subject: More gracefully handle a situation where starting shell failed X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~10940 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=42e3a93c2080625ba5c24672c668373ca5ea15c6;p=gnome-shell.git More gracefully handle a situation where starting shell failed If start_shell() threw an exception before, we'd overwrite it with an exception in the finally() clause. Handle this and just print a message and let the exception propagate. --- diff --git a/src/gnome-shell.in b/src/gnome-shell.in index 035ccd3e4..2acc967ed 100644 --- a/src/gnome-shell.in +++ b/src/gnome-shell.in @@ -253,6 +253,7 @@ if options.debug: normal_exit = False try: + shell = None if options.xephyr: xephyr = start_xephyr() # This makes us not grab the org.gnome.Panel name @@ -281,7 +282,9 @@ finally: except OSError: pass - if shell.returncode == 0: + if shell is None: + print "Failed to start shell" + elif shell.returncode == 0: normal_exit = True if options.verbose: print "Shell exited normally"